{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "d4e9d799",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "c:\\Users\\yuhon\\.conda\\envs\\nlp\\Lib\\site-packages\\huggingface_hub\\file_download.py:144: UserWarning: `huggingface_hub` cache-system uses symlinks by default to efficiently store duplicated files but your machine does not support them in C:\\Users\\yuhon\\.cache\\huggingface\\hub\\datasets--AiresPucrs--sentiment-analysis. Caching files will still work but in a degraded version that might require more space on your disk. This warning can be disabled by setting the `HF_HUB_DISABLE_SYMLINKS_WARNING` environment variable. For more details, see https://huggingface.co/docs/huggingface_hub/how-to-cache#limitations.\n",
      "To support symlinks on Windows, you either need to activate Developer Mode or to run Python as an administrator. In order to activate developer mode, see this article: https://docs.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development\n",
      "  warnings.warn(message)\n",
      "Generating train split: 100%|██████████| 85089/85089 [00:00<00:00, 166955.21 examples/s]\n",
      "Creating CSV from Arrow format: 100%|██████████| 86/86 [00:03<00:00, 27.27ba/s]\n",
      "Generating train split: 85089 examples [00:00, 90500.95 examples/s] \n"
     ]
    }
   ],
   "source": [
    "from datasets import load_dataset,load_from_disk\n",
    "\n",
    "#在线加载数据\n",
    "dataset = load_dataset(path=\"AiresPucrs/sentiment-analysis\",split=\"train\")\n",
    "#转存csv格式\n",
    "dataset.to_csv(path_or_buf=r\"E:\\nlp\\model_cache\\sentiment-analysis.csv\")\n",
    "#加载csv格式数据\n",
    "dataset2 = load_dataset(path=\"csv\",data_files= r\"E:\\nlp\\model_cache\\sentiment-analysis.csv\")"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
